/**
 * Alibaba.com.cn Inc.
 * Copyright (c) 2004-2021 All Rights Reserved.
 */
package com.starlink.common.enums;

import java.util.Arrays;

/**
 * @author zhanghong
 * @version OrderTypeEnum.java, v 0.1 2024/4/11 22:26 下午 OrderTypeEnum Exp $$
 */
public enum VipEnum {

    VIP_FOREVER(1, "永久有效"),
    VIP_CUSTOM_DEFINITION(2, "自定义时限");

    private Integer type;
    private String desc;

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    VipEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static VipEnum getByType(Integer type) {
        if (type == null) {
            return null;
        }
        return Arrays.stream(values()).filter(item -> type.equals(item.getType())).findFirst().orElse(null);
    }
}
